package com.ocl.www.service;

import com.ocl.www.domain.Lyarticle;
import com.ocl.www.domain.PageObject;
import com.ocl.www.mapper.LyarticleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/5/28.
 */
@Service
public class LyArticleService {


    @Autowired
    private LyarticleMapper lyarticleMapper ;

    @Autowired
    private RedisTemplate redisTemplate;

    public int insertlyArticle(Lyarticle art) throws  Exception{
        // TODO Auto-generated method stub
        int c =  0;

        c =  lyarticleMapper.insertlyArticle(art);

        return c;
    }
//    @Cacheable(value = "selectlyArticleList",keyGenerator = "wiselyKeyGenerator")
    public List<Lyarticle> selectlyArticleList() throws Exception{

        List<Lyarticle> lyarticleList = lyarticleMapper.selectlyArticleList();

        return lyarticleList;
    }

    public Lyarticle getArticle(Lyarticle lyarticle)  throws Exception{

        return lyarticleMapper.getArticle(lyarticle);
    }

    public int addOneCommCount(Lyarticle art) throws  Exception{
        // TODO Auto-generated method stub
        int c =  0;

        c =  lyarticleMapper.addOneCommCount(art);

        return c;
    }


    public List<Lyarticle> selectArticleMoreInfo(PageObject pageObject) throws  Exception{
        return lyarticleMapper.selectArticleMoreInfo(pageObject);
    }

    public List<Lyarticle> selectArticleMoreInfo_old(PageObject pageObject)throws Exception {
        return lyarticleMapper.selectArticleMoreInfo_old(pageObject);
    }
}
